<?php 
include '../config/DBConnect.php';

$maphong=$_GET['maphong'];
$get_room="SELECT * FROM sinhvien JOIN sinhvien_phong ON sinhvien.masv=sinhvien_phong.masv WHERE sinhvien_phong.maphong='$maphong'";
$query=mysql_query($get_room);
$list_sv=array();
if (mysql_num_rows($query) > 0){

	while($rows=mysql_fetch_array($query)){
		$temp=array();
		$temp['masv']=$rows['masv'];
		$temp['hoten']=$rows['hoten'];
		$temp['anh']=$rows['anh'];
		$temp['quequan']=$rows['quequan'];
		$temp['nienkhoa']=$rows['nienkhoa'];
		array_push($list_sv,$temp);
	}
}else{
	echo "KhÔng có sinh viên nào !!";
}
?>
<span><b>Thông Tin Sinh Viên Phòng :<?php echo $maphong; ?></b></span>
<table border="0">
	<tr style="background:#339933;">
		<td><b>Ảnh</b></td>
		<td><b>Họ Tên</b></td>
		<td><b>Mã Sinh Viên<b></td>
		<td><b>Quê Quán</b></td>
		<td><b>Niên Khóa</b></td>
	</tr>
	<tbody style="background:#DBEAF9;">
		<?php foreach ($list_sv as  $value) {
			
		 ?>
		<tr>
			<td><img src="<?php echo $value['anh']; ?>"/></td>
			<td><?php echo $value['hoten']; ?></td>
			<td><?php echo $value['masv']; ?></td>
			<td><?php echo $value['quequan']; ?></td>
			<td><?php echo $value['nienkhoa']; ?></td>
		</tr>
		<?php } ?>
	</tbody>
</table>